﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Constants;
using Budget.Events_Args;

namespace Budget
{
    public partial class FormSelectData : Form
    {
        public delegate void OnDataSelectionEventHandler(object sender,DataSelectionEventArgs e);
        public event OnDataSelectionEventHandler OnDataSelectionClickEvent;
        
        
        public FormSelectData()
        {
            InitializeComponent();
        }

        private void buttonExpenses_Click(object sender, EventArgs e)
        {
            if (OnDataSelectionClickEvent != null)
            {
                OnDataSelectionClickEvent(this, new DataSelectionEventArgs(Tables.NumExpenses));
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void buttonIncome_Click(object sender, EventArgs e)
        {
            if (OnDataSelectionClickEvent != null)
            {
                OnDataSelectionClickEvent(this, new DataSelectionEventArgs(Tables.NumIncome));
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
    }
}
